RegisterDependent
TheRegisterDependent
method puts the specified destination part on the list of parts to be notified whenever the link is updated.
void RegisterDependent (in ODPart clientPart, in ODUpdateID id);
clientPart
- A reference to the destination part wishing to be notified of changes to the content of the link source.
id
- The update ID of the content the specified part last read from the link source.
DISCUSSION
If your part is a destination of this link, you can call this method to register your part as a dependent of this link object. Dependent parts receive automatic notification of any changes to the link's content. You can remove your part from the list of dependents by calling theUnregisterDependent
method.You should call this method in your part's
HandleEvent
method after calling theShowLinkDestinationInfo
method if the user has requested automatic notification of updates and your part is not already a registered dependent of this link object.If the link's current update ID differs from the
id
parameter, OpenDoc immediately calls the specified client part'sLinkUpdated
method. You should pass the constantkODUnknownUpdate
as the value of theid
parameter when the link is first created; doing so ensures that your part'sLinkUpdated
method is called.
- IMPORTANT
- You should not call this method if your part is already a registered dependent of this link object, for example, because your part contains another destination of link source corresponding to this link object.
![]()
EXCEPTIONS
kODErrBrokenLink
- Internal error; the link-source object disconnected from its destinations.
kODErrCannotRegisterDependent
- The link object is unable to register the specified part as a dependent at this time.
SEE ALSO
TheODUpdateID
type (page 917).
TheODLink::GetUpdateID
method (page 353).
TheODLink::ShowLinkDestinationInfo
method (page 357).
TheODLink::UnregisterDependent
method (page 361).
TheODPart::LinkUpdated
method (page 533).
"Selection Info" on page 252 in OpenDoc Programmer's Guide.
"Automatic and Manual Updating" on page 372 in OpenDoc Programmer's Guide.
"Creating a Link at the Destination" on page 380 in OpenDoc Programmer's Guide.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help